#include "Gap.h"


Gap::Gap(void)
{
}

Gap::Gap( Contig *c1, int o1, Contig *c2, int o2, int g, string scaf )
{
	m_startContig = c1;
	m_startOri = o1;
	m_endContig = c2;
	m_endOri = o2;
	m_gapSize = g;
	m_scaf = scaf;
	m_subgraph = new set<Contig*>;
	m_ifPrint = false;
	m_gapSeq = "";
	m_calculatedGapSize = -999;
}


Gap::~Gap(void)
{
	m_subgraph->clear();
	delete m_subgraph;
}

int Gap::GetGapSize()
{
	return m_gapSize;
}

Contig* Gap::GetStartContig()
{
	return m_startContig;
}

Contig* Gap::GetEndContig()
{
	return m_endContig;
}

int Gap::GetStartOri()
{
	return m_startOri;
}

int Gap::GetEndOri()
{
	return m_endOri;
}

void Gap::SetGap( string s )
{
	m_scaf = s;
}

void Gap::SetEndString( string s )
{
	m_endString = s;
}

void Gap::SetStartString( string s )
{
	m_startString = s;
}

string Gap::GetStartString()
{
	return m_startString;
}

string Gap::GetEndString()
{
	return m_endString;
}

string Gap::GetGapString()
{
	return m_scaf;
}

void Gap::SetID( int id )
{
	m_id = id;
}

int Gap::GetMaxGapSize()
{
	if( m_gapSize < 0 )
		return 0;
	else
		return m_gapSize*2;
}

int Gap::GetID()
{
	return m_id;
}

void Gap::SetSubgraph( set<Contig*> *nodes )
{
	m_subgraph->insert( nodes->begin(), nodes->end() );
}


void Gap::SetIfPrint( bool p )
{
	m_ifPrint = p;
}

bool Gap::IfPrint()
{
	return m_ifPrint;
}
set<Contig*>* Gap::GetSubgraph()
{
	return m_subgraph;
}

void Gap::SetNumOfEdges( int e )
{
	m_numOfEdges = e;
}
	
int Gap::GetNumOfEdges()
{
	return m_numOfEdges;
}

void Gap::RemoveNode( Contig *c )
{
	m_subgraph->erase( c );
}

void Gap::SetGapSeq( string s )
{
	m_gapSeq = s;
}
	
string Gap::GetGapSeq()
{
	return m_gapSeq;
}

void Gap::SetCalculatedGapSize( int s )
{
	m_calculatedGapSize = s;
}
	
int Gap::GetCalculatedGapSize()
{
	return m_calculatedGapSize;
}


